#include <iostream>
#include <string>
#include <sstream>
#include <cctype>
#include <algorithm>

using namespace std;

// Q1. 为视频标题生成标签
// https://leetcode.cn/contest/weekly-contest-454/problems/generate-tag-for-video-caption/description/

class Solution
{
public:
    string removeNonAlpha(const string &input)
    {
        string result;
        for (char ch : input)
        {
            if (isalpha(ch))
            {
                result += ch;
            }
        }
        return result;
    }

    string generateTag(string caption)
    {
        string ans = "#";
        istringstream ist(caption);
        string curStr;
        bool isOnece = true;
        while (ist >> curStr)
        {
            removeNonAlpha(curStr);
            transform(curStr.begin(), curStr.end(), curStr.begin(), ::tolower);

            if (isOnece)
            {
                isOnece = false;
            }else{
                if(curStr[0] >= 'a' && curStr[0] <= 'z'){
                    curStr[0] -= 32;
                }
            }
            ans += curStr;
        }
        return ans.substr(0, 100);
    }
};

int main()
{
    return 0;
}